package com.service.impl;

import com.bean.dangBean.Consumer;
import com.dao.dangDao.ConsumerMapper;
import com.service.ConsumerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
@Service("consumerService")
public class ConsumerServiceImpl implements ConsumerService {

    @Autowired
    private ConsumerMapper consumerMapper;
    @Override
    public int save(Consumer consumer) {
        return consumerMapper.insert(consumer);
    }

    @Override
    public int remove(Consumer consumer) {
        return consumerMapper.delete(consumer);
    }

    @Override
    public int modify(Consumer consumer) {
        return consumerMapper.update(consumer);
    }

    @Override
    public List<Consumer> find(Consumer consumer) {
        return consumerMapper.select(consumer);
    }

    @Override
    public int count(Map<String, Object> map) {
        return consumerMapper.selectCount(map);
    }

    @Override
    public List<Consumer> query(Map<String, Object> map) {
        return consumerMapper.selectByPage(map);
    }
}
